home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
fopen
/
fopen.bas
< prev
next >
Wrap
BASIC Source File
|
1995-05-09
|
2KB
|
47 lines
DefInt A-Z
' This is used by OpenFile when we check if a file exists
Type OfStruct
RecLen As String * 1
IsFixed As String * 1
ErrCode As Integer
Reserved As String * 4
CompleteName As String * 128
End Type
' OpenFile is used to check if a file exists.
' Lclose closes the file opened with OpenFile
Declare Function OpenFile Lib "kernel" (ByVal fname$, aStruct As OfStruct, ByVal ofstyle%) As Integer
Declare Function lclose Lib "kernel" Alias "_lclose" (ByVal FHandle%) As Integer
' These give us the Win3 like Drive/Subdirectory listing
Declare Function GetFocus Lib "user" () As Integer
Declare Function SendMessage Lib "user" (ByVal a%, ByVal b%, ByVal c%, ByVal d As Any) As Long
' The following variables are shared by all forms.
' FormTitle specifies FOPEN.FRM's title so the Parent can change it at will.
' FullName is the complete filename the user selects with FOPEN.FRM; it includes drive,
' subdirectory and filename (empty if the user presses Cancel). TheFileName is the
' filename. ThePath contains the path for open file, can also be used to point to a
' different path for FOPEN.FRM. ThePattern sets/resets the file pattern, e.g. "*.BAS"
Global FormTitle As String
Global FullName As String
Global TheFileName As String
Global ThePath As String
Global ThePattern As String
' These are used by the API functions
Global Const WM_USER = &H400
Global Const LB_DIR = WM_USER + 14
Global Const LB_RESETCONTENT = WM_USER + 5
Global Const EM_LIMITTEXT = WM_USER + 21
Global Const OF_EXIST = &H4000
' These are self explanatory
Global Const Modal = 1
Global Const true = -1
Global Const false = 0